﻿// ———————————————————————–
// <copyright file=""ValList".cs" company="The MITRE Corporation">
//    Copyright (c) 2014 The MITRE Corporation. All rights reserved.
//    Licensed under the Apache License, Version 2.0 (the "License");
//    you may not use this file except in compliance with the License.
//    You may obtain a copy of the License at
//    http://www.apache.org/licenses/LICENSE-2.0
//    Unless required by applicable law or agreed to in writing, software
//    distributed under the License is distributed on an "AS IS" BASIS,
//    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//    See the License for the specific language governing permissions and
//    limitations under the License.
// </copyright>
// ———————————————————————–
/////////////////////////////////////////////////////////////////////////////////////////////////
// ValListDB.cs - XML Serializer for Router Rule 
// Project: EDXLSharp_AWSRouter - ICNETSerializers
//
// Language:    C#, .NET 4.0
// Platform:    Windows 7, VS 2013
// Author:      Brian Wilkins The MITRE Corporation
/////////////////////////////////////////////////////////////////////////////////////////////////

// Copyright (c) 2014 The MITRE Corporation. All rights reserved.
//
// NOTICE
// This software was produced for the U. S. Government
// under Contract No. FA8721-09-C-0001, and is
// subject to the Rights in Noncommercial Computer Software
// and Noncommercial Computer Software Documentation Clause
// (DFARS) 252.227-7014 (JUN 1995)

using Amazon.DynamoDBv2.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml.Linq;
using System.Xml.Serialization;

namespace ICNETSerializers
{
  [Serializable]
  [XmlRoot("ValLists", Namespace = "mitre:icnet:aws:1.0")]
  public class ValLists
  {
    #region Public Delegates/Events

    #endregion Public Delegates/Events

    #region Private Member Variables
    List<ValList> mVLists;
    private static readonly log4net.ILog Log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);

    #endregion Private Member Variables

    #region Constructors

    public ValLists()
    {
      mVLists = new List<ValList>();
    }
    #endregion Constructors

    #region Public Accessors
    /// <summary>
    /// Gets or sets the list of ValueLists
    /// </summary>
    [XmlElement("valList")]
    public List<ValList> ValueLists
    {
      get { return mVLists; }
      set { mVLists = value; }
    }
    #endregion Public Accessors

    #region Public Member Functions

    #endregion Public Member Functions

    #region Protected Member Functions

    #endregion Protected Member Functions

    #region Private Member Functions

    #endregion Private Member Functions
                
  }

  [Serializable]
  public class ValList
  {
    #region Public Delegates/Events

    #endregion Public Delegates/Events

    #region Private Member Variables

    private string mValueListUrn;
    private List<string> mValues;

    #endregion Private Member Variables

    #region Constructors

    #endregion Constructors

    #region Public Accessors
    /// <summary>
    /// Gets or sets the ValueList urn
    /// </summary>
    [XmlElement("valueListUrn")]
    public string ValueListUrn
    {
      get { return mValueListUrn; }
      set { mValueListUrn = value; }
    }

    /// <summary>
    /// Gets or sets the ValueList values
    /// </summary>
    [XmlArray("value")]
    public List<string> Value
    {
      get { return mValues; }
      set { mValues = value; }
    }

    [XmlIgnore]
    public bool ValueSpecified
    {
      get
      {
        bool hasValues = mValues != null && mValues.Count > 0;
        return hasValues;
      }
      set { }
    }
    #endregion Public Accessors

    #region Public Member Functions

    #endregion Public Member Functions

    #region Protected Member Functions

    #endregion Protected Member Functions

    #region Private Member Functions

    #endregion Private Member Functions
                
  }
}
